package com.wecan.api.saasdata;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wecan.base.PO.Role;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @Author liuzhihao
 * @Date 2022.01.18
 * @Version ${version}
 * @Description ${description}
 */
@FeignClient(name = "saasdata", path = "/role")
public interface RoleData {
    @PostMapping(value = "/insert")
    Integer insert(@RequestBody Role role);

    @PostMapping(value = "/updatebyid")
    Integer updateById(@RequestBody Role role);

    @PostMapping(value = "/deletebyid")
    Integer deleteById(@RequestParam("id") Integer id);

    @PostMapping(value = "/selectlist")
    List<Role> selectList();

    @PostMapping(value = "/selectpage")
    Page<Role> selectPage(@RequestParam("pageNum") Integer pageNum, @RequestParam("pageSize") Integer pageSize, @RequestBody Role role);

    @PostMapping(value = "/selectbyname")
    Role selectByName(@RequestParam("name") String name);

    @PostMapping(value = "/getusermarks")
    List<Integer> getUserMarks(@RequestBody List<Integer> roleList);

    @PostMapping(value = "/queryrolebyid")
    Role queryRoleById(@RequestParam("id") Integer id);
}
